import{U as h}from"./CtybWkkwagutd.js";import{d as n,t as s,u as _,bj as l,a9 as c,s as d,bg as y,bk as b,b as r,o,bm as g,ab as p,ar as f,ah as w,aO as $}from"./CtbHscGXagutd.js";const u=n({__name:"app-list-item-table-amount",props:{item:{}},setup(e){return(t,a)=>s(_(l)(e.item.gross))}}),v=n({__name:"app-list-item-table-category",props:{item:{}},setup(e){const t=e,a=c(()=>t.item._type==="doc"?Object.values(t.item.positions).map(i=>d.workspace?.items?.[i.category??""]?.title??"?").join(", "):t.item.category);return(i,m)=>s(a.value)}}),x=n({__name:"app-list-item-table-contact",props:{item:{}},setup(e){return(t,a)=>s((e.item.contact&&_(d).workspace?.items?.[e.item.contact]?.title)??" ")}}),k=n({__name:"app-list-item-table-currency",props:{item:{}},setup(e){return(t,a)=>s(e.item.currency)}}),C=n({__name:"app-list-item-table-date",props:{item:{}},setup(e){return(t,a)=>s(_(y)(e.item?.date))}}),j=n({__name:"app-list-item-table-gross",props:{item:{}},setup(e){const t=e,a=c(()=>t.item._type==="pay"?l(t.item.amount,t.item.currency):l(b(t.item.gross,t.item.currency,t.item.exchangeRate)));return(i,m)=>s(a.value)}}),B={class:"app-list-item-table-id"},D=n({__name:"app-list-item-table-id",props:{item:{}},setup(e){return(t,a)=>(o(),r("span",B,s(e.item._id??" "),1))}}),O=n({__name:"app-list-item-table-raw",props:{item:{}},setup(e){const t=c(()=>{const a={...e.item};return delete a._id,delete a._type,delete a.title,g(Object.keys(a)).join(", ")});return(a,i)=>(o(),r("pre",null,s(t.value??" "),1))}}),S=n({__name:"app-list-item-table-title",props:{item:{}},setup(e){return(t,a)=>s(e.item.title??" ")}}),z={class:"app-list-item-table-kind"},A=n({__name:"app-list-item-table-type",props:{item:{}},setup(e){return(t,a)=>(o(),r("span",z,s(e.item._type??" "),1))}}),E=[{name:"date",component:C,width:100},{name:"id",component:D,width:180},{name:"type",component:A,width:160},{name:"raw",component:O,width:1e3},{name:"title",component:S},{name:"contact",component:x},{name:"category",component:v},{name:"amount",align:"right",component:u,width:160},{name:"currency",component:k,width:80},{name:"gross",align:"right",component:j,width:160},{name:"net",align:"right",component:u,width:160}],I=c(()=>["date",p.silver&&"gross",p.silver&&"amount",p.silver&&"currency","contact","category"].filter(h));c(()=>I.value.map(e=>E.find(t=>t.name===e)));const W=n({__name:"app-table-col",props:{name:{},align:{},header:{type:Boolean},width:{}},setup(e){const t=e,a=c(()=>[`_col_${t.name}`,`_col_align_${t.align??"left"}`]),i=c(()=>({width:`${t.width??200}px`}));return(m,N)=>(o(),r("div",{class:w(["app-list-table-item-col",a.value]),style:f(i.value)},[$(m.$slots,"default")],6))}});export{W as _,E as a,I as d};